﻿@model OKRs.Models.UserViewModels.SaveUserFormModel

@{
    ViewData["Title"] = "Edit User";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<ol class="breadcrumb">
    <li><a asp-controller="Home" asp-action="Index">Home</a></li>
    <li><a asp-controller="User" asp-action="Index">Users</a></li>
    @*<li><a asp-controller="User" asp-action="Details" asp-route-id="@Model.Id">@Model.Name</a></li>*@
</ol>

<h3>Edit User</h3>

<div class="row">
    <div class="col-md-4">
        <form asp-action="Edit" method="POST" asp-route-id="@Model.Id">
            <div asp-validation-summary="ModelOnly" class="text-danger"></div>
            <div class="form-group">
                <label asp-for="UserName" class="control-label"></label>
                <input asp-for="UserName" class="form-control" />
                <span asp-validation-for="UserName" class="text-danger"></span>
            </div>
            <div class="form-group">
                <label asp-for="Name" class="control-label"></label>
                <input asp-for="Name" class="form-control" />
                <span asp-validation-for="Name" class="text-danger"></span>
            </div>
            <div class="form-group">
                <label asp-for="Email" class="control-label"></label>
                <input asp-for="Email" class="form-control" />
                <span asp-validation-for="Email" class="text-danger"></span>
            </div>
            <div class="form-group">
                <input type="submit" value="Save" class="btn btn-primary" />
            </div>
        </form>
    </div>
</div>
<div class="row">
    <div class="col-md-4">
        @if(Model.IsInactive) {
            <form asp-action="Activate" method="POST" asp-route-id="@Model.Id">
                <div class="form-group">
                    <input type="submit" value="Activate" class="btn btn-success" />
                </div>
            </form>
        } else {
            <form asp-action="Inactivate" method="POST" asp-route-id="@Model.Id">
                <div class="form-group">
                    <input type="submit" value="Inactivate" class="btn btn-warning" />
                </div>
            </form>
        }
    </div>
</div>


